package com.vayne.lifecycle;

import com.vayne.bean.Person;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.support.PropertiesBeanDefinitionReader;

/**
 * @author xuerui.zhang
 * @since 2020/4/17 下午1:27
 */
public class BeanDefinitionLifeCycleDemo {

    public static void main(String[] args) {
        DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
        PropertiesBeanDefinitionReader beanDefinition = new PropertiesBeanDefinitionReader(beanFactory);
        String path = "person.properties";
        beanDefinition.loadBeanDefinitions(path);
        Person person = beanFactory.getBean("person", Person.class);
        System.out.println(person);
    }
}
